package com.sakura.tx;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Sakura
 * @Date 2023-03-08 16:25
 */
@Service
public class userService {

    @Autowired
    private userDao userDao;

    @Transactional
    public void insert(){
        userDao.insert();
        System.out.println("插入成功....");

        //模拟异常
        int i = 10/0;
    }
}
